package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the DIYSTATUS_ database table.
 * 
 */
@Entity
@Table(name="DIYSTATUS_")
@NamedQuery(name="Diystatus.findAll", query="SELECT d FROM Diystatus d")
public class Diystatus implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="DIYSTATUS__DIYSTATUSID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DIYSTATUS__DIYSTATUSID_GENERATOR")
	@Column(name="DIYSTATUS_ID")
	private long diystatusId;

	@Column(name="DIYSTATUS_CREATER")
	private String diystatusCreater;

	@Column(name="DIYSTATUS_IFDELETE")
	private BigDecimal diystatusIfdelete;

	@Column(name="DIYSTATUS_INTODATE")
	private Date diystatusIntodate;

	@Column(name="DIYSTATUS_NAME")
	private String diystatusName;

	@Column(name="DIYSTATUS_STATE")
	private String diystatusState;

	//bi-directional many-to-one association to Content
	@OneToMany(mappedBy="diystatus")
	@JSONField(serialize=false)
	private List<Content> contents;

	//bi-directional many-to-one association to Repairorder
	@OneToOne
	@JoinColumn(name="REPAIRORDER_ID")
	private Repairorder repairorder;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;

	public Diystatus() {
	}

	public long getDiystatusId() {
		return this.diystatusId;
	}

	public void setDiystatusId(long diystatusId) {
		this.diystatusId = diystatusId;
	}

	public String getDiystatusCreater() {
		return this.diystatusCreater;
	}

	public void setDiystatusCreater(String diystatusCreater) {
		this.diystatusCreater = diystatusCreater;
	}

	public BigDecimal getDiystatusIfdelete() {
		return this.diystatusIfdelete;
	}

	public void setDiystatusIfdelete(BigDecimal diystatusIfdelete) {
		this.diystatusIfdelete = diystatusIfdelete;
	}

	public Date getDiystatusIntodate() {
		return this.diystatusIntodate;
	}

	public void setDiystatusIntodate(Date diystatusIntodate) {
		this.diystatusIntodate = diystatusIntodate;
	}

	public String getDiystatusName() {
		return this.diystatusName;
	}

	public void setDiystatusName(String diystatusName) {
		this.diystatusName = diystatusName;
	}

	public String getDiystatusState() {
		return this.diystatusState;
	}

	public void setDiystatusState(String diystatusState) {
		this.diystatusState = diystatusState;
	}

	public List<Content> getContents() {
		return this.contents;
	}

	public void setContents(List<Content> contents) {
		this.contents = contents;
	}
	

	public Content addContent(Content content) {
		getContents().add(content);
		content.setDiystatus(this);

		return content;
	}

	public Content removeContent(Content content) {
		getContents().remove(content);
		content.setDiystatus(null);

		return content;
	}

	public Repairorder getRepairorder() {
		return this.repairorder;
	}

	public void setRepairorder(Repairorder repairorder) {
		this.repairorder = repairorder;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}